<?php

namespace App\CustHub\Controller\Admin\Website;

use App\CustHub\Controller\BaseController;
use App\CustHub\Service\ChGetConfigService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\GetMapping;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;

#[Controller(prefix: "custhub/chGetConfig")]
class ChGetConfigController extends BaseController
{
    #[Inject]
    protected ChGetConfigService $service;

    /**
     * 站点配置
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    #[GetMapping('getConfig')]
    public function getConfig()
    {
        return $this->success($this->service->getConfig());
    }

    /**
     * 加盟配置
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    #[GetMapping('joinConfig')]
    public function getJoinConfig()
    {
        return $this->success($this->service->getjoinConfig());
    }


    /**
     * 发展列表
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    #[GetMapping('developCourse')]
    public function getDevelopCourse()
    {
        return $this->success($this->service->getDevelopCourse());
    }

    /**
     * 公司介绍
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    #[GetMapping('companyIntroduction')]
    public function getCompanyIntroduction()
    {
        return $this->success($this->service->getCompanyIntroduction());
    }

    /**
     * 咨询配置
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    #[GetMapping('consultingConfig')]
    public function getConsultingConfig()
    {
        return $this->success($this->service->getConsultingConfig());
    }
}